package cn.springcloud.fix.quartz.service;

import cn.springcloud.fix.common.core.base.BaseResponse;
import cn.springcloud.fix.quartz.api.request.CreateJobRequest;
import cn.springcloud.fix.quartz.api.request.ListJobRequest;
import cn.springcloud.fix.quartz.api.request.TriggerJobRequest;
import cn.springcloud.fix.quartz.api.request.UpdateJobRequest;
import cn.springcloud.fix.quartz.api.response.ListJobResponse;
import org.quartz.SchedulerException;
import org.quartz.Trigger;

import java.util.List;

public interface ScheduleService {

    ListJobResponse getJobs(ListJobRequest request);

    List<? extends Trigger> getTriggers(String a);

    BaseResponse triggerJob(TriggerJobRequest request);

    BaseResponse createJob(CreateJobRequest request);

    void reBuildJobTask(String taskId, String group, String cronExpression) throws SchedulerException;

    BaseResponse updateJob(UpdateJobRequest request);

    BaseResponse deleteJob(String id);

    BaseResponse pauseJob(String id);

    BaseResponse resumeJob(String id);
}
